/* ============ 标签容器 ============ */

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============ 标签 ============ */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

/* ============ 标签类型 ============ */

.tag-default {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tag-default:hover {
    background: var(--border-color);
}

.tag-primary {
    background: rgba(0, 102, 204, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.tag-primary:hover {
    background: rgba(0, 102, 204, 0.2);
}

.tag-success {
    background: rgba(82, 196, 26, 0.1);
    color: #52c41a;
    border: 1px solid #52c41a;
}

.tag-success:hover {
    background: rgba(82, 196, 26, 0.2);
}

.tag-warning {
    background: rgba(250, 173, 20, 0.1);
    color: #faad14;
    border: 1px solid #faad14;
}

.tag-warning:hover {
    background: rgba(250, 173, 20, 0.2);
}

.tag-error {
    background: rgba(245, 34, 45, 0.1);
    color: #f5222d;
    border: 1px solid #f5222d;
}

.tag-error:hover {
    background: rgba(245, 34, 45, 0.2);
}

.tag-info {
    background: rgba(24, 144, 255, 0.1);
    color: #1890ff;
    border: 1px solid #1890ff;
}

.tag-info:hover {
    background: rgba(24, 144, 255, 0.2);
}

/* ============ 标签大小 ============ */

.tag-small {
    padding: 4px 8px;
    font-size: 12px;
}

.tag-medium {
    padding: 6px 12px;
    font-size: 14px;
}

.tag-large {
    padding: 8px 16px;
    font-size: 16px;
}

/* ============ 标签图标 ============ */

.tag-icon {
    display: inline-flex;
    align-items: center;
    font-size: 1em;
}

/* ============ 关闭按钮 ============ */

.tag-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    transition: var(--transition);
}

.tag-close:hover {
    opacity: 0.7;
}

/* ============ 标签输入框 ============ */

.tag-input-wrapper {
    width: 100%;
}

.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-white);
    transition: var(--transition);
}

.tag-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-input-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 102, 204, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
}

.tag-input-label {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-input-remove {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    transition: var(--transition);
}

.tag-input-remove:hover {
    opacity: 0.7;
}

.tag-input-field {
    flex: 1;
    min-width: 100px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
}

.tag-input-field::placeholder {
    color: var(--text-secondary);
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .tag-container {
        gap: 6px;
    }

    .tag {
        padding: 5px 10px;
        font-size: 13px;
    }

    .tag-input-container {
        padding: 6px;
        gap: 6px;
    }

    .tag-input-item {
        padding: 5px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tag {
        padding: 4px 8px;
        font-size: 12px;
    }

    .tag-input-item {
        padding: 4px 8px;
        font-size: 12px;
    }

    .tag-input-field {
        min-width: 80px;
        font-size: 13px;
    }
}
